package com.ivo.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ivo.model.Model;

@Entity
@org.hibernate.annotations.Entity(dynamicUpdate=true)
@Table (name = "PDM_D_ATTACHMENT")
public class Attachment extends Model {
	
	private static final long serialVersionUID = 6677729026635299198L;

	private Long attachmentId;
	private MasterInstance mastIns;
	private String fileName;
	private Long fileSize;
	private String owner_FK;
	
	public Attachment(){}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ATTACHMENT_ID")
	public Long getAttachmentId() {
		return attachmentId;
	}

	public void setAttachmentId(Long attachmentId) {
		this.attachmentId = attachmentId;
	}
	
	@ManyToOne(cascade = {CascadeType.MERGE})
	@JoinColumn(name = "MAST_INS_FK")
	public MasterInstance getMastIns() {
		return mastIns;
	}

	public void setMastIns(MasterInstance mastIns) {
		this.mastIns = mastIns;
	}
	
	@Column(name = "FILE_NAME")
	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	@Column(name = "FILE_SIZE")
	public Long getFileSize() {
		return fileSize;
	}

	public void setFileSize(Long fileSize) {
		this.fileSize = fileSize;
	}

	@Column(name = "OWNER_FK")
	public String getOwner_FK() {
		return owner_FK;
	}

	public void setOwner_FK(String owner_FK) {
		this.owner_FK = owner_FK;
	}
	
}
